﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MappitLib;
using System.Drawing;

namespace Mappit.CmdTilemap {
    public class SetTile : Command {
        private TilemapEditor receiver_;
        private Tile tile_;
        private Point drop_location_;
        private Tile old_tile_;
        public SetTile(TilemapEditor receiver, Tile tile, Point drop_location) {
            receiver_ = receiver;
            tile_ = tile;
            drop_location_ = drop_location;
            old_tile_ = receiver.GetTile(drop_location);
        }
        public override void Execute() {
            receiver_.SetTile(tile_, drop_location_);
        }
        public override void Undo() {
            receiver_.SetTile(old_tile_, drop_location_);
        }
    }
}
